#include <xen/delay.h>
#include <xen/time.h>
#include <xen/sched.h>
+#include <xen/console.h>
#include <asm/mc146818rtc.h>
#include <asm/smp.h>
#include <asm/msr.h>
void nmi_watchdog_tick (struct pt_regs * regs)
{
- extern spinlock_t console_lock;
extern void die(const char * str, struct pt_regs * regs, long err);
int sum, cpu = smp_processor_id();
* before doing the oops ...
*/
alert_counter[cpu]++;
- if (alert_counter[cpu] == 5*nmi_hz) {
- console_lock = SPIN_LOCK_UNLOCKED;
+ if ( alert_counter[cpu] == 5*nmi_hz )
+ {
+ console_force_unlock();
die("NMI Watchdog detected LOCKUP on CPU", regs, cpu);
}
}
#include <xen/lib.h>
#include <xen/errno.h>
#include <xen/mm.h>
+#include <xen/console.h>
#include <asm/ptrace.h>
#include <xen/delay.h>
#include <xen/spinlock.h>
unsigned long esp;
unsigned short ss;
- esp = (unsigned long) (®s->esp);
+ esp = (unsigned long)(®s->esp);
ss = __HYPERVISOR_DS;
if ( regs->xcs & 3 )
{
asmlinkage void do_double_fault(void)
{
- extern spinlock_t console_lock;
struct tss_struct *tss = &doublefault_tss;
unsigned int cpu = ((tss->back_link>>3)-__FIRST_TSS_ENTRY)>>1;
printk("************************************\n");
/* Lock up the console to prevent spurious output from other CPUs. */
- spin_lock(&console_lock);
+ console_force_lock();
/* Wait for manual reset. */
for ( ; ; ) ;
die("general protection fault", regs, error_code);
}
-asmlinkage void mem_parity_error(unsigned char reason, struct pt_regs * regs)
+asmlinkage void mem_parity_error(unsigned char reason, struct pt_regs *regs)
{
- printk("NMI received. Dazed and confused, but trying to continue\n");
+ console_force_unlock();
+
+ printk("\n\nNMI received. Dazed and confused, but trying to continue\n");
printk("You probably have a hardware problem with your RAM chips\n");
/* Clear and disable the memory parity error line. */
outb(reason, 0x61);
show_registers(regs);
- panic("PARITY ERROR");
+
+ printk("************************************\n");
+ printk("CPU%d MEMORY ERROR -- system shutdown\n", smp_processor_id());
+ printk("System needs manual reset.\n");
+ printk("************************************\n");
+
+ /* Lock up the console to prevent spurious output from other CPUs. */
+ console_force_lock();
+
+ /* Wait for manual reset. */
+ for ( ; ; ) ;
}
-asmlinkage void io_check_error(unsigned char reason, struct pt_regs * regs)
+asmlinkage void io_check_error(unsigned char reason, struct pt_regs *regs)
{
- printk("NMI: IOCK error (debug interrupt?)\n");
+ console_force_unlock();
+
+ printk("\n\nNMI: IOCK error (debug interrupt?)\n");
reason = (reason & 0xf) | 8;
outb(reason, 0x61);
show_registers(regs);
- panic("IOCK ERROR");
+
+ printk("************************************\n");
+ printk("CPU%d I/O ERROR -- system shutdown\n", smp_processor_id());
+ printk("System needs manual reset.\n");
+ printk("************************************\n");
+
+ /* Lock up the console to prevent spurious output from other CPUs. */
+ console_force_lock();
+
+ /* Wait for manual reset. */
+ for ( ; ; ) ;
}
static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
# reload DS and ES when handling them.
inb $0x61,%al
testb $0x80,%al
- jne nmi_parity_err
+ je nmi_parity_err
testb $0x40,%al
jne nmi_io_err
movl %eax,%ebx
movl $(__HYPERVISOR_DS),%edx
movl %edx,%ds
movl %edx,%es
- jmp SYMBOL_NAME(mem_parity_error)
+ movl %esp,%edx
+ push %edx
+ push %eax
+ call SYMBOL_NAME(mem_parity_error)
+ ud2
nmi_io_err:
movl $(__HYPERVISOR_DS),%edx
movl %edx,%ds
movl %edx,%es
- jmp SYMBOL_NAME(io_check_error)
-
+ movl %esp,%edx
+ push %edx
+ push %eax
+ call SYMBOL_NAME(io_check_error)
+ ud2
+
.data
ENTRY(hypercall_table)
.long SYMBOL_NAME(do_set_trap_table) /* 0 */